package com.project.mapper.core;

import com.project.mapper.common.BaseMapper;
import com.project.model.core.AdminRole;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface AdminRoleMapper extends BaseMapper<AdminRole, Long> {

    /**
     * 删除admin、role的级联关系
     *
     * @param key
     * @return int(成功的行数)
     */
    int delete(AdminRole key);


    /**
     * 保存admin、role的级联关系
     *
     * @param record
     * @return int(如果含有selectKey返回主键，否则返回NULL)
     */
    int save(AdminRole record);

    /**
     * 批量保存
     *
     * @param adminRoleList
     * @return
     */
    int saveAdminRoles(@Param("adminRoleList") List<AdminRole> adminRoleList);

    /**
     * 批量删除
     *
     * @param adminRoleList
     * @return
     */
    int delAdminRoles(@Param("adminRoleList") List<AdminRole> adminRoleList);

    /**
     * 根据roleId删除adminRole外键关联关系
     *
     * @param roleId
     */
    void deleteByRoleId(Long roleId);

}